package com.otod.commons.startup;

import javax.servlet.ServletContextEvent;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.context.ContextLoaderListener;

import com.otod.commons.tools.OpenOfficeServer;

/**
 * context初始化
 * @author jqiu
 */
public class ContextInit extends ContextLoaderListener {
	protected static final Logger logger = LoggerFactory.getLogger(ContextInit.class);

	public void contextInitialized(ServletContextEvent context) {
		super.contextInitialized(context);
		
		SysInit.init();							//加载 init方法
		
		OpenOfficeServer.start();
	}
	

	/**
	 * Close the root web application context.
	 */
	public void contextDestroyed(ServletContextEvent event) {
		super.contextDestroyed(event);
		
		OpenOfficeServer.stop();
	}
}
